#include <iostream>


/**
 * 计算A+B
 */
int main(){
    int A,B;
    std::cin >> A >> B;

    int res = 0;
    while(true){
        res = A^B;
        int carry = (A&B) << 1;
        if (carry == 0){
            break;
        }
        A = res;
        B = carry;
    }

    std::cout << res;

    return 0;
}